/**
 * 
 */
package com.topline.xiaocaifeng.configure;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author Administrator
 *
 */
@Configuration
public class ToplineConfigurerAdapter extends WebMvcConfigurerAdapter{

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        
        /**
         * 将静态文件指定到 磁盘路径
         * addResourceHandler方法的参数为访问路径正则表达式
         * addResourceLocations方法的参数为静态资源路径
         */
//        registry.addResourceHandler("/topline/**").addResourceLocations("file:D:/topline/");
        
        registry.addResourceHandler("/**").
            addResourceLocations("file:D:/topline/").
            addResourceLocations("classpath:/META-INF/resources/").
            addResourceLocations("classpath:/resources/").
            addResourceLocations("classpath:/static/").
            addResourceLocations("classpath:/public/");
        
        
        registry.addResourceHandler("/**").addResourceLocations("file:D:/topline/",
                "classpath:/META-INF/resources/",
                "classpath:/resources/",
                "classpath:/static/",
                "classpath:/public/");
    }
    
}
